package com.cmcc.shared.model

import android.os.Parcel
import android.os.Parcelable

data class DriverCache(
    val avatarFileAddress: String,
    val currentCoordinates: CurrentCoordinates,
    val id: String,
    val name: String,
    var driverCar: DriverCar
)

data class CurrentCoordinates(
    val x: Double,//longitude
    val y: Double//latitude
)

data class DriverCar(
    val id: String,
    val driverId: String,
    val idCard: String,
    val model: String,
    val carCategory: CarCategory
)

data class CarCategory(
    val id: String?,
    val name: String?,
    val kilometreFee: Double,
    val minuteFee: Double
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readDouble(),
        parcel.readDouble())

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeString(name)
        parcel.writeDouble(kilometreFee)
        parcel.writeDouble(minuteFee)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<CarCategory> {
        override fun createFromParcel(parcel: Parcel): CarCategory {
            return CarCategory(parcel)
        }

        override fun newArray(size: Int): Array<CarCategory?> {
            return arrayOfNulls(size)
        }
    }
}

data class DriverInfo(
    val id: String,
    val openId: String,
    val name: String,
    val phone: String,
    val email: String,
    val headPortraitAddress: String,
    val driverCardNumber: String,
    val driverCardFileAddress: String,
    val workCardNumber: String,
    val workCardFileAddress: String,
    val workStatus: Int,
    val reviewStatus: Int
)